import { Component, EventEmitter, Output } from '@angular/core';
import { SrmOrientation } from 'src/components/scenarios/enums';
import { SrmConfig } from 'src/components/scenarios/models';

@Component({
  selector: 'app-srm-setting',
  templateUrl: './srm-setting.component.html',
  styleUrl: './srm-setting.component.scss'
})
export class SrmSettingComponent {
  orientations: SrmOrientation[] = Object.values(SrmOrientation);
  sidebarVisible: boolean = false;
  cfg?: SrmConfig;
  @Output()
  onHide: EventEmitter<SrmConfig> = new EventEmitter();

  onEdit(cfg: SrmConfig) {
    this.cfg = { ...cfg };
    this.sidebarVisible = true;
  }
  onSidebarHide() {
    this.onHide.next(this.cfg!);
    this.cfg = undefined;
  }
}
